/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fait.ferm.ui.tables;

import fait.ferm.datafx.TableRow;
import fait.ferm.global.Glob;
import fait.ferm.persists.SimpleDirItem;
import java.util.Date;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 *
 * @author alex
 */
public class ResourcePayRow {
	@TableRow(orderNo=1, displayName="Ресурс")
	private final SimpleObjectProperty<SimpleDirItem> taxes;
	@TableRow(orderNo=2, displayName="Сумма")
	private final SimpleDoubleProperty quantity;
	@TableRow(orderNo=3, displayName="Дата")
	private final StringProperty begDate;
	@TableRow(orderNo=4, displayName="Выполнено")
	private final BooleanProperty group;


	public SimpleObjectProperty<SimpleDirItem> taxesProperty(){return taxes;}
	public SimpleDirItem getTaxes() {return taxes.get();}
	public void setTaxes(SimpleDirItem p) {taxes.set(p);}

	public SimpleDoubleProperty quantityProperty(){return quantity;}
	public Double getQuantity() {return quantity.get();}
	public void setQuantity(double p) {quantity.set(p);}

    public final StringProperty begDateProperty() { return begDate; }
    public String getBegDate() { return begDate.get(); }
    public void setBegDate(String newName) { begDate.set(newName); }
	
    public final BooleanProperty groupProperty() { return group; }
    public boolean isGroup() { return group.get(); }
    public void setGroup (boolean v) {group.set(v);    }
	

	public ResourcePayRow( SimpleDirItem sup, double quantity, Date begDate, boolean  bb) {
		
		this.taxes = new SimpleObjectProperty<>(sup);
		this.quantity = new SimpleDoubleProperty(quantity);
		this.begDate = new SimpleStringProperty( Glob.dateFormat.format(begDate));
		this.group = new SimpleBooleanProperty( bb);

	}
	
}
